<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css">
    <link href="../script/swiper/swiper.min.css" rel="stylesheet" />
    <style type="text/css">
    html,body{
        height: auto;
    }
    
    .movie_float_re{position: relative;}
    .movie_float_ab{ position: absolute;right: 4px;
		bottom: 55px;
		padding: 2px 6px;
		background: rgba(0,0,0,.8);
		color: #fff;
		border-radius: 2px;
		right:5px;
	}
	
    </style>
</head>
<body class="H-theme-background-color-white">

   
	
    <script  id="listtmp" type="text/x-dot-template">
	    {{? it && it.length > 0}}<!--it 就是传入的数组data 这里判断是否为真，数组元素是否大于0个 ?相当于if-->
			{{~ it :v}}<!--it 相当如js的foreach v就是data数组中的一个元素-->
	    		<div onclick="$app.openWinByUrl('shop_detail','shop_detail',{ 'title':'{{= v.title}}','img':'{{= v.img}}','url':'{{= v.url}}'  , 'type':'{{= v.type}}' })" class="movie_float_re  H-display-table-cell H-width-avg-2 H-float-left H-box-sizing-border-box H-padding-horizontal-both-5">
	                <img src="{{= v.img}}" class=" H-display-block H-width-100-percent" style="height:90px;">
	                <div class="H-text-show-row-1  H-font-size-14">{{= v.title}}</div>
	                <span class="H-text-show-row-1 H-font-size-14 H-theme-font-color-ccc ">{{= v.desc}}</span>
	                {{? v.update}} <div class="movie_float_ab H-font-size-12">{{= v.update}}</div> {{?}}
	            </div>
	       {{~}}
		{{?}}<!--相当于/if -->
    </script>
    
    <script  id="dylisttmp" type="text/x-dot-template">
	    {{? it && it.length > 0}}<!--it 就是传入的数组data 这里判断是否为真，数组元素是否大于0个 ?相当于if-->
			{{~ it :v}}<!--it 相当如js的foreach v就是data数组中的一个元素-->
	    		<div style="height: 220px;" onclick="$app.openWinByUrl('shop_detail','shop_detail',{ 'title':'{{= v.title}}','img':'{{= v.img}}','url':'{{= v.url}}' , 'type':'{{= v.type}}'  })" class="movie_float_re  H-display-table-cell H-width-avg-2 H-float-left H-box-sizing-border-box H-padding-horizontal-both-5">
	                <img src="{{= v.img}}" class=" H-display-block H-width-100-percent" style="height:170px;">
	                <div class="H-text-show-row-1  H-font-size-14">{{= v.title}}</div>
	                <span class="H-text-show-row-1 H-font-size-14 H-theme-font-color-ccc ">{{= v.desc}}</span>
	                {{? v.update}} <div class="movie_float_ab H-font-size-12">{{= v.update}}</div> {{?}}
	            </div>
	       {{~}}
		{{?}}<!--相当于/if -->
    </script>
    
    <div id="list" class="H-display-table H-width-100-percent H-clear-both H-box-sizing-border-box H-padding-horizontal-both-5">
    	 
            
    </div>

    
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="../script/app.js"></script>
<script type="text/javascript" src="../script/doT.js"></script>

<script type="text/javascript">
	
	

	
	var kw = "";
	var huxing  = "";
	var zujin = "";
	var page = 1;
	var is_page = true;
    
	var sysconfig = "";//获取系统配置参数 , 参数内容在后台接口获取
	var subway = "";
	
	var type = "";  

    apiready = function(){
    	sysconfig = $api.getStorage('sysconfig');
		api.parseTapmode();

		type = api.pageParam.type_id;
		

		kw = api.pageParam.keyword;
		if( typeof kw !='undefined'){
			kw = kw;
		}
		
		api.addEventListener({
	        name:'list_search'
        },function(ret,err){
        	kw = ret.value.keyword;
        	
	    	hotHouse();
	    	
        });
		
		//获取热门房屋信息
		hotHouse();
		
	
	
	
    };
    
    
    
     function hotHouse(){
    	$app.ajax($app.serverUrl+"index/index/so",{
    		'kw':kw 
    	},'post',function(ret){
			if( ret.code == 1000){
				if( ret.result.page != 1){
					is_page = false;
				}
				var evalText = doT.template($("#dylisttmp").text());
				if( page ==1 ){
					$("#list").html(evalText(ret.result.data));
				} else {
					$("#list").append(evalText(ret.result.data));
				}
			}
		});
    }
    
    

	
</script>
</html>